package stage1.test;

public class People {
    private String name;
    private int age;
    public static String country;

    public People() {
    }

    public People(String name, int age) {
        setName(name);
        setAge(age);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age<0 || age>150){
            System.out.println("年龄不合理");
        }else {
            this.age = age;
        }
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        People.country = country;
    }

    @Override
    public String toString() {
        return "People{" +
                "name='" + getName() + '\'' +
                ", age=" + getAge() +
                ", country='" + getCountry() + '\'' +
                '}';
    }
}
